In recent years, flash memory devices have been widely used in computer related equipment and other electronics appliances as storage devices. The nonvolatile and on-chip programmable capabilities of a flash memory are very important for storing data in many applications. As an example, flash memories are frequently used for the BIOS storage of a personal computer. In addition, the small physical size of flash memories also makes them very suitable for portable applications. Therefore, they have been used for storing programs and data for many portable electronic devices such as cellular phones, digital cameras and video game platforms.
The popularity of flash memories in many different applications has raised an important issue regarding data security in using these memory devices. For some applications such as BIOS, the stored codes are designed to be unchangeable. For other applications such as games, it is desirable that the stored codes are not only unchangeable but also unreadable. Therefore, different mechanisms for providing flash memory data protection have been presented and used by memory manufacturers. Two approaches to protecting the memory data are generally available. One approach provides sector protection and the other provides file protection.
For flash memories with sector protection, the data stored in certain physical locations are protected together. The memory array is divided into a number of sectors. Both erase and program operations in any combination of the sectors can be disabled. Users determine if each sector should be protected. The state of protection for each sector is programmed and stored in the memory chip. Whenever an erase or program operation is to be executed, the information regarding the protection state of the selected sector is checked first. If the selected sector is protected, the operation will be disabled without execution.
Different from a normal random access memory (RAM) that can be randomly read, erased and programmed on a byte basis, a conventional flash memory features a byte-program and a sector-erase capability with each sector containing a number of bytes. Because the data within a sector can not be selected for erasure individually, a flash memory has to erase the data of a whole sector, i.e., an erase sector, and then program the new data byte by byte. As can be easily seen, the smaller the size of a protection sector, the more flexible is the configuration of the flash memory. However, the size of a protection sector is always limited to a number greater than the size of an erase sector. Typically, a protection sector contains a number of erase sectors. The large size of a protection sector makes the flash memory very inflexible and inefficient. For example, the size of a protection sector (protection size) of a 16M byte flash memory device may be 512 word lines that includes 2M bytes of memories. If 10K data have to be protected from being read, the other 1.99M bytes of flash memory cells in the same sector will not be readable either.
In contrast to the sector protection approach, the second approach protects the data of a file regardless of the physical location of the data in the flash memory. It uses an extra memory called attribute memory to store much information of a file, including the protection information, the starting address, the ending address, the defect information, erase/program counts, . . . , etc. When a file is accessed, its information is retrieved from the attribute memory first. If the information shows that the file is protected, the erase and program operations will be disabled. In some applications, the contents of the attribute memory are read out and temporarily stored in an external system.
Because the attribute memory needs to be updated frequently, a flash memory is not appropriate for serving as an attribute memory due to the limitation in the size of an erase sector. As a result, the prior arts proposed using an electrical-erasable-programmable-read-only-memory (EEPROM) instead of a flash memory for the attribute memory. However, this approach requires two different memory technologies to be used on one memory chip. The fabrication process of such a memory device is not only difficult but also expensive. In addition, each cell of an EEPROM consists of two transistors which result in larger cell area in manufacturing the device.